﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace MapSample
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            while (NavigationService.RemoveBackEntry() != null) ;
            base.OnNavigatedTo(e);
        }

        private void ShowPin_Click(object sender, RoutedEventArgs e)
        {
            // Go to page with example of use of markers.
            NavigationService.Navigate(new Uri("/MapWithPin.xaml", UriKind.Relative));
        }

        private void ShowRoute_Click(object sender, RoutedEventArgs e)
        {
            // Go to page with example of route.
            NavigationService.Navigate(new Uri("/MapWithRoute.xaml", UriKind.Relative));
        }

        private void ShowAddresses_Click(object sender, RoutedEventArgs e)
        {
            // Go to page with example address search.
            NavigationService.Navigate(new Uri("/MapWithResearch.xaml", UriKind.Relative));
        }

        private void RouteWithMyLocalization_Click(object sender, RoutedEventArgs e)
        {
            // Go to page with example of route between the user's current location and destination.
            NavigationService.Navigate(new Uri("/MapWithMyLocalization.xaml", UriKind.Relative));
        }
    }
}